#include<stdio.h>
int main()
{
    int link(int n);
    int num;
    scanf("%d\n",&num);
    printf("%d\n",link(num));
}
int link(int n)
{
    int i,j,sum=0;
    int num=1;
    scanf("%d\n",&n);
    for(i=1;i<=n;n++)
    {
        for(j=1;j<=i;j++)
        {
            num=num*j;
        }
        sum=sum+num;
    }
    return sum;
}